package com.example.happiness.controller;

import com.example.happiness.websocket.WebSocketServer;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//@Api(tags = "管理员工相关接口")
@Slf4j
@RestController
@RequestMapping()
public class WebSocketController {

    @Autowired
    WebSocketServer webSocketServer;

    @GetMapping("/admintouser")
    public void test(String id, String message){
        webSocketServer.sendToClient(message,id );
    }
    @GetMapping("/usertoadmin")
    public void test2(String message){
        webSocketServer.sendToClient2(message);
    }
}
